let xhr1 = new XMLHttpRequest();
xhr1.open('get', `http://39.105.198.203:3001/prod/index`);
xhr1.send();
xhr1.onreadystatechange = function () {
    if (this.readyState === 4) {
        let res = JSON.parse(this.responseText);
        // console.log(res)
        let pic = $('<div></div>')
        pic.html(`
        <img class="pic" src="${res.data.banner}" alt="">
        `)
        $('.headPicture').append(pic);
        console.log(res.data.list)

        res.data.list.forEach(function(item,index){
             let li = $(' <li class="li"></li>')
               li.html(`
                 <a href='./detail.html?id=${item.tid}'>
                 <div class="contentBox">
                        <div>
                            <img class="smPic" src="${item.fullSrc}" alt="">
                        </div>
                        <div class="text">
                            <p>${item.tname}</p>
                            <span class="fuhao">￥ <span class="price">${item.price}<span class="bot">.00<span></span></span>
                        </div>
                    </div>
                 </a>    
            `)
              $('.list').append(li);
        })

        $('.footer div').click(function(){
            $(this).addClass('current').siblings().removeClass('current')
        })
    }
}

